package com.dyzx.hbb.modules.fcxs.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dyzx.hbb.common.config.MyLambdaQueryWrapper;
import com.dyzx.hbb.modules.fcxs.entity.FcxsOrder;
import com.dyzx.hbb.modules.fcxs.service.FcxsOrderService;
import com.dyzx.hbb.modules.fcxs.mapper.FcxsOrderMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【fcxs_order(订单表)】的数据库操作Service实现
* @createDate 2025-05-17 20:53:29
*/
@Service
public class FcxsOrderServiceImpl extends ServiceImpl<FcxsOrderMapper, FcxsOrder>
    implements FcxsOrderService{

    @Override
    public FcxsOrder fondByOrderIdOrOrderNo(Long orderId, String orderNo) {
        // 根据订单ID或订单号查询订单信息
        MyLambdaQueryWrapper<FcxsOrder> query = new MyLambdaQueryWrapper<>();
        query.eq(orderId != null,FcxsOrder::getId, orderId)
                . or().eq(StringUtils.isNotBlank(orderNo),FcxsOrder::getOrderNo, orderNo);
        return this.getOne(query);

    }

    @Override
    public FcxsOrder fondByOrderId(Long orderId) {
        return this.getById(orderId);
    }
}




